﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    DomFun
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<h2>DomFun</h2>
    <button id="makeHtmlButton">Make Html</button>
    <button id="putAfterButton">Put Something After</button>
    <button id="putBeforeButton">Put Something Before</button>
    <button id="clearListButton">Clear Button</button>
    <button id="wrapListButton">Wrap the List</button>
    
    
    <div id="Holder1">
    
    </div>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="CssContent" runat="server">

</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="JavascriptContent" runat="server">
   <script type="text/javascript">
       $(function () {

           $("#makeHtmlButton").click(function () {
               $("#Holder1").html("<ul><li>Stuff</li></ul>");
           });

           $("#putAfterButton").click(function () {
               var parent = $("#Holder1 ul");
               $("<li>After</li>").appendTo(parent);
           });

           $("#putBeforeButton").click(function () {
               var parent = $("#Holder1 ul");
               $("<li>Before</li>").prependTo(parent);
           });

           $("#clearListButton").click(function () {
               var parent = $("#Holder1 ul");
               parent.html("");
           });

           $("#wrapListButton").click(function () {
               var parent = $("#Holder1 ul");
               parent.wrap("<span />");
           });
       });
   
   </script>

</asp:Content>
